import axios from "axios";
import { collectApi, collectListApi, deletecollectApi } from "../../api/collect"

export default {
    namespaced: true,
    state: {
        collectlist: [],
    },
    mutations: {
        // 设置收藏的对象数组
        setcollectList(state, value) {
            state.collectlist = value;
            // console.log(state.collectlist, "aaaaaaaaaaaaaaa");
            // 重新渲染dom结构
            // this.dispatch("spot/requestALLData",this.state.spot.activeIndex)
        },
    },
    actions: {
        async requestData(context) {
            // 发送请求,
            const 
                data
             = await collectListApi();
            // console.log(data, "oo11oo");


            // 获得数据
            context.commit("setcollectList", data.data)

        },
    },


}